var t = require("../../utils/api.js"), e = (require("../../utils/util.js"), require("../../wxParse/wxParse.js"));

getApp();

Page({
    data: {
        title: "页面内容",
        pageData: {},
        pagesList: {},
        hidden: !1,
        wxParseData: []
    },
    onLoad: function(t) {
        this.fetchData(t.id), this.fetchPagesData();
    },
    onShow: function(t) {},
    fetchData: function(a) {
        var s = this;
        s.setData({
            hidden: !1
        }), wx.request({
            url: t.getPageByID(a, {
                mdrender: !1
            }),
            success: function(t) {
                console.log(t), s.setData({
                    pageData: t.data,
                    wxParseData: e.wxParse("article", "html", t.data.content.rendered, s, 5)
                }), setTimeout(function() {
                    s.setData({
                        hidden: !0
                    });
                }, 300);
            }
        });
    },
    fetchPagesData: function() {
        var e = this;
        wx.request({
            url: t.getPages(),
            success: function(t) {
                e.setData({
                    pagesList: t.data
                }), setTimeout(function() {
                    e.setData({
                        hidden: !0
                    });
                }, 300);
            }
        });
    }
});